package com.gagakuai.transport.bootstrap;

import com.gagakuai.transport.channel.*;
import com.gagakuai.utils.internal.ObjectUtil;

import java.net.SocketAddress;

/*
 * @description: 服务启动类
 * @author: houhong
 * @create: 2024-03-18 23:18
 */
public class ServerBootstrap extends AbstractBootstrap<ServerBootstrap, ServerChannel> implements Cloneable {


    private volatile EventLoopGroup childGroup;

    private volatile ChannelHandler childHandler;

    public ServerBootstrap group(EventLoopGroup parentGroup, EventLoopGroup childGroup) {

        super.group(parentGroup);

        this.childGroup = childGroup;

        return this;
    }

    @Override
    public ServerBootstrap group(EventLoopGroup group) {

        group(group, group);

        return this;
    }


    /*====================设置channelHandler=====================================*/
    public ServerBootstrap childHandler(ChannelHandler childHandler) {

        if (childHandler == null) {
            throw new NullPointerException("childHandler");
        }
        this.childHandler = childHandler;
        return this;
    }

































}
